﻿using System.Drawing;

namespace LocationAwareness
{
    /// <summary>
    /// Class representing a POI on the client.
    /// </summary>
    public class POI
    {
        public string Name;
        public string Distance;
        public string Categorie;
        public string ObjectID;
        public string ImagePath;
        public Bitmap PoiImage = null;
    }

    /// <summary>
    /// Class representing a POI shown in detail view on the client.
    /// </summary>
    public class PoiDetail
    {
        public PoiDetail()
        {
        }

        /// <summary>
        /// Instanciating PoiDetail by the attributes of the passed PoiView.
        /// </summary>
        public PoiDetail(PoiView poiView)
        {
            name = poiView.Name;
            categorie = poiView.Categorie;
            objectID = poiView.ObjectID;
        }

        private string name;
        public string Name
        {
            get
            {
                return name;
            }
        }

        private string categorie;
        public string Categorie
        {
            get
            {
                return categorie;
            }
        }

        private string objectID;
        public string ObjectID
        {
            get
            {
                return objectID;
            }
        }

        public string Address;
        public string StreetNr;
        public double Distance;

        public string Opening;
        public string Desc;

        public string ImagePath;
        public string MapPath;
        public Bitmap DetailImage;
        public Image Map;
        public double Lat;
        public double Long;

        /// <summary>
        /// Copies attributes of the passed PoiDetail in the actual instance.
        /// </summary>
        /// <param name="detail">PoiDetail from wich attributes are copied</param>
        public void copyAttributes(PoiDetail detail)
        {
            this.Address = detail.Address;
            this.Desc = detail.Desc;
            this.Distance = detail.Distance;
            this.DetailImage = detail.DetailImage;
            this.ImagePath = detail.ImagePath;
            this.Map = detail.Map;
            this.MapPath = detail.MapPath;
            this.Opening = detail.Opening;
            this.StreetNr = detail.StreetNr;
            this.Lat = detail.Lat;
            this.Long = detail.Long;
        }

        /// <summary>
        /// Updates the distance from poi to user.
        /// </summary>
        /// <param name="distance">Updated distance</param>
        public void updatePoiDetail(double distance)
        {
            this.Distance = distance;
        }

        /// <summary>
        /// ToString method
        /// </summary>
        /// <returns>Name of the POI</returns>
        public override string ToString()
        {
            return name;
        }
    }
}
